class_name AbilitySystemComponent
extends Node

##
var logic_owner

## 标签管理器
var tag_manager: GameplayTagManager

## 运行时能力
var ability_manager: GameplayAbilityManager

## 运行时效果
var effect_manager: GameplayEffectManager

## 属性集
@export var attribute_set: GameplayAttributeSet

## 对象固有的能力资源
@export var ability_assets: Array[GameplayAbilityAsset]


func _ready() -> void:
	tag_manager = GameplayTagManager.new()
	
	ability_manager = GameplayAbilityManager.new(self)
	for ability_asset: GameplayAbilityAsset in ability_assets:
		ability_manager.grant_ability(ability_asset)
	
	effect_manager = GameplayEffectManager.new(self)


func _process(delta: float) -> void:
	ability_manager.on_update(delta)
	effect_manager.on_update(delta)
